package com.weiz.designpatterns.flyweight;

public class FlyweightTest {
    public static void main(String[] args) {
        String text = "ABCABBCC";

        char[] chs = text.toCharArray();

        CharacterFactory factory = CharacterFactory.getInstance();

        for (int i = 0; chs != null && i < chs.length; i++) {

            char ch = chs[i];
            Character key = Character.valueOf(ch);

            ICharacter character = factory.getCharacter(key);
            character.display();
        }
    }
}
